<?php use_helper('Javascript')?>
<div class="form_buttons">
    <?php 
      echo 
        submit_to_remote(
          'saveButton',
          'Save',
          array(
            'url'=>$save_url,
            'update'=>sfConfig::get('app_windows_contact_id'),
            'method'=>'post',
            'script'=>true,
            'loading'=>"Element.show('indicator')",
            'complete'=>"Element.hide('indicator');".
            (($new)?'':remote_function(
              array(
                'update'=>$contact_row,
                'url'=>$update_url.'&dialog_mode='.$sf_params->get('dialog_mode','0'),
              )
            )),
          )
        );
    ?>
    <?php if(! $new):?>
      | <?php 
        echo 
          submit_to_remote(
            'deleteButton',
            'Delete',
            array(
              'url'=>$delete_url,
              'update'=>sfConfig::get('app_windows_contact_id'),
              'method'=>'post',
              'confirm'=>'Delete '.$form_type.' "'.$list_name.'"?',
              'script'=>true,
              'loading'=>"Element.show('indicator')",
              'complete'=>"Element.hide('indicator');",
            )
          )
      ?>
    <?php endif;?>
    | <?php 
        echo 
          submit_to_remote(
            'resetButton',
            'Reset',
            array(
              'url'=>$reset_url,
              'update'=>sfConfig::get('app_windows_contact_id'),
              'method'=>'post',
              'confirm'=>$new?'Reset form for new '.$form_type.'?':'Reset form '.$form_type.' "'.$list_name.'"?',
              'script'=>true,'loading'=>"Element.show('indicator')",'complete'=>"Element.hide('indicator')",
            )
          );
      ?>
</div>